package com.bruce.practice.if_enum;

/**
 * @author luotuan
 * @create 2019-01-09 14:27
 **/
public class Calculator {
    public static void main(String[] args) {
        int result = calculate(1,4,Operator.valueOf("ADD"));
        System.out.println("Result-->"+result);
    }
    public static int calculate(int a, int b, Operator operator) {
        return operator.apply(a, b);
    }
}
